package com.msmall.community.play.cases.service;

import java.util.List;

import com.msmall.base.pager.PaginationSupport;
import com.msmall.base.service.BaseManager;
import com.msmall.community.play.cases.model.Action;
import com.msmall.community.play.cases.model.Scenario;
import com.msmall.community.play.cases.model.Target;

public interface ScenarioManager extends BaseManager<Scenario, Long>{
	
	public void getScenariosByCases(PaginationSupport page, Long casesId);
	
	public void saveScenario(Scenario scenario, Long casesId, Long actionId, Long targetId);
	
	public void removeScenario(Long scenarioId) throws Exception;
	
	public void saveAction(Action action, Long scenarioId);
	
	public void saveTarget(Target target, Long scenarioId);
	
	/**
	 * 删除动作时，同时删除相关的场景，通过scenarioCode查找相关的场景.需要级联
	 * @param actionId
	 * @throws Exception 
	 */
	public void removeAction(Long actionId) throws Exception;
	/**
	 * 删除对象时，同时删除相关的场景，通过scenarioCode查找相关的场景.需要级联
	 * @param targetId
	 * @throws Exception 
	 */
	public void removeTarget(Long targetId) throws Exception;
	
	/**
	 * 通过场景ID获得此场景下所有的ACTION
	 * @param scenarioId
	 * @return
	 * @throws Exception 
	 */
	public List<Action> getActionsByScenario(Long scenarioId) throws Exception;
	
	/**
	 *  通过场景ID获得此场景下所有的TARGET
	 * @param scenarioId
	 * @return
	 * @throws Exception 
	 */
	public List<Target> getTargetsByScenario(Long scenarioId) throws Exception;
}
